package com.itheima.controller;


import com.itheima.pojo.Report;
import com.itheima.pojo.Result;
import com.itheima.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ProductService productService;

    @GetMapping("/productUpOrDown")
    public Result productUpOrDown(){
        log.info("baiandandn")

        List<Report> result=productService.getProductUpOrDown();

        return Result.success(result);
    }


    @GetMapping("/productStatus")
    public Result productStatus(){

        List<Report> result=productService.getproductStatus();

        return Result.success(result);
    }


}
